/**
 * Copyright (c) 2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// Autogenerated file -- DO NOT EDIT!

bool IsETSIntrinsic(ark::compiler::RuntimeInterface::IntrinsicId intrinsicId)
{
    switch(intrinsicId) {
% ['LD_OBJ', 'ST_OBJ'].each do |name|
        case ark::compiler::RuntimeInterface::IntrinsicId::INTRINSIC_COMPILER_ETS_<%= name %>_BY_NAME_OBJ:
        case ark::compiler::RuntimeInterface::IntrinsicId::INTRINSIC_COMPILER_ETS_<%= name %>_BY_NAME_F64:
        case ark::compiler::RuntimeInterface::IntrinsicId::INTRINSIC_COMPILER_ETS_<%= name %>_BY_NAME_F32:
        case ark::compiler::RuntimeInterface::IntrinsicId::INTRINSIC_COMPILER_ETS_<%= name %>_BY_NAME_I64:
        case ark::compiler::RuntimeInterface::IntrinsicId::INTRINSIC_COMPILER_ETS_<%= name %>_BY_NAME_I32:
% end
            return true;
        default:
            return false;
    }
}

bool IsAbcKitIntrinsic(ark::compiler::RuntimeInterface::IntrinsicId intrinsicId)
{
    switch(intrinsicId) {
#include "dyn_intrinsics_cases.inc"
% Compiler::intrinsics.select {|intrinsic| intrinsic.space == "abckit" }.each do |intrinsic|
        case ark::compiler::RuntimeInterface::IntrinsicId::<%= intrinsic.entrypoint_name %>:
% end
            return true;
        default:
            return IsETSIntrinsic(intrinsicId);
    }
}

% ['InitObject', 'LoadObject', 'StoreObject', 'LoadStatic', 'StoreStatic', 'LoadArray', 'StoreArray', 'NewArray'].each do |name|
bool IsAbcKit<%= name %>(ark::compiler::RuntimeInterface::IntrinsicId intrinsicId)
{
    switch(intrinsicId) {
%   Compiler::intrinsics.select {|intrinsic| intrinsic.space == "abckit" }.each do |intrinsic|
        case ark::compiler::RuntimeInterface::IntrinsicId::<%= intrinsic.entrypoint_name %>:
%     if (intrinsic.class_name == name)
            return true;
%     else
            return false;
%     end
%   end
        default:
            return false;
    }
}
% end

bool IsAbcKitIntrinsicRange(ark::compiler::RuntimeInterface::IntrinsicId id)
{
    if (id == ark::compiler::RuntimeInterface::IntrinsicId::DYN_CALLRANGE_IMM8_IMM8_V8 ||
        id ==  ark::compiler::RuntimeInterface::IntrinsicId::DYN_WIDE_CALLRANGE_PREF_IMM16_V8 ||
        id ==  ark::compiler::RuntimeInterface::IntrinsicId::DYN_CALLTHISRANGE_IMM8_IMM8_V8 ||
        id ==  ark::compiler::RuntimeInterface::IntrinsicId::DYN_WIDE_CALLTHISRANGE_PREF_IMM16_V8 ||
        id ==  ark::compiler::RuntimeInterface::IntrinsicId::DYN_NEWOBJRANGE_IMM8_IMM8_V8 ||
        id ==  ark::compiler::RuntimeInterface::IntrinsicId::DYN_NEWOBJRANGE_IMM16_IMM8_V8 ||
        id ==  ark::compiler::RuntimeInterface::IntrinsicId::DYN_WIDE_NEWOBJRANGE_PREF_IMM16_V8 ||
        id ==  ark::compiler::RuntimeInterface::IntrinsicId::DYN_SUPERCALLTHISRANGE_IMM8_IMM8_V8 ||
        id ==  ark::compiler::RuntimeInterface::IntrinsicId::DYN_SUPERCALLARROWRANGE_IMM8_IMM8_V8 ||
        id ==  ark::compiler::RuntimeInterface::IntrinsicId::DYN_WIDE_SUPERCALLTHISRANGE_PREF_IMM16_V8 ||
        id ==  ark::compiler::RuntimeInterface::IntrinsicId::DYN_WIDE_SUPERCALLARROWRANGE_PREF_IMM16_V8 ||
        id ==  ark::compiler::RuntimeInterface::IntrinsicId::DYN_CREATEOBJECTWITHEXCLUDEDKEYS_IMM8_V8_V8 ||
        id ==  ark::compiler::RuntimeInterface::IntrinsicId::DYN_WIDE_CREATEOBJECTWITHEXCLUDEDKEYS_PREF_IMM16_V8_V8)
    {
        return true;
    }
    switch(id) {
% Compiler::intrinsics.select {|intrinsic| intrinsic.space == "abckit" }.each do |intrinsic|
        case ark::compiler::RuntimeInterface::IntrinsicId::<%= intrinsic.entrypoint_name %>:
%   if (intrinsic.method_name.include? "range")
            return true;
%   else
            return false;
%   end
% end
        default:
            return false;
    }
}
